Any number of actions may be executed in response to a single QuickTime event. By using sprite track variables to maintain state, as well as conditional and looping actions, more sophisticated event handlers may be created--similar to If..Then and While statements in the C programming language.
The target of an action specifies on which element of the movie the action should be performed. Each action has an associated target type. For example, the action kActionSpriteSetVisible should only target a sprite--not a track or movie. Most of the track actions need to target either a specific track type, or a subset of track types, such as spatial or audio tracks. The target types include sprite, track, movie, 3D nodes, and no target.
Sprite and track targets may be specified in several different ways using names, IDs, or indices.
Targets are resolved at the time their action is executed. This is important to keep in mind because movies may change over time. Actions which are intended to target a movie element for the current movie time should precede actions which change the movie time. Sprites, for example, may be considered to have a lifetime lasting from one key frame to the next, so a sprite with a certain ID at one time may be different from a sprite with the same ID at another time in the movie.
Note that you may only target "live" movie elements, that is, ones that exist for the current movie time.
All events except the frameLoaded event are sent to a specific sprite or QuickDraw 3D node. This sprite is considered the current default Sprite target, and its track is considered the current default Track target. Since the frameLoaded event is sent to a sprite track, only the default track target is set.
| Previous | Chapter Contents | Chapter Top | Next |